function convertTime(date:Date) {
  const year = date.getFullYear()
  // 注意：月份是从0开始的，所以需要+1
  const month = date.getMonth() + 1 
  const day = date.getDate()
  const hours = date.getHours()
  const minutes = date.getMinutes()
  const seconds = date.getSeconds()

  // 转换成年月日
  const dateString = year + '-' + month + '-' + day

  // 转换成年月日时分秒
  const dateTimeString = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds

  return [ dateString, dateTimeString ]
}

export default convertTime